{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"min\", \"max\", \"step\", \"defaultValue\", \"value\", \"disabled\", \"readOnly\", \"upHandler\", \"downHandler\", \"keyboard\", \"controls\", \"stringMode\", \"parser\", \"formatter\", \"precision\", \"decimalSeparator\", \"onChange\", \"onInput\", \"onPressEnter\", \"onStep\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport getMiniDecimal, { toFixed, getNumberPrecision, num2str, validateNumber } from '@rc-component/mini-decimal';\nimport StepHandler from './StepHandler';\nimport { getDecupleSteps } from './utils/numberUtil';\nimport useCursor from './hooks/useCursor';\nimport useFrame from './hooks/useFrame';\n/**\n * We support `stringMode` which need handle correct type when user call in onChange\n * format max or min value\n * 1. if isInvalid return null\n * 2. if precision is undefined, return decimal\n * 3. format with precision\n *    I. if max > 0, round down with precision. Example: max= 3.5, precision=0  afterFormat: 3\n *    II. if max < 0, round up with precision. Example: max= -3.5, precision=0  afterFormat: -4\n *    III. if min > 0, round up with precision. Example: min= 3.5, precision=0  afterFormat: 4\n *    IV. if min < 0, round down with precision. Example: max= -3.5, precision=0  afterFormat: -3\n */\nvar getDecimalValue = function getDecimalValue(stringMode, decimalValue) {\n  if (stringMode || decimalValue.isEmpty()) {\n    return decimalValue.toString();\n  }\n  return decimalValue.toNumber();\n};\nvar getDecimalIfValidate = function getDecimalIfValidate(value) {\n  var decimal = getMiniDecimal(value);\n  return decimal.isInvalidate() ? null : decimal;\n};\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _classNames;\n  var _props$prefixCls = props.prefixCls,\n    prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,\n    className = props.className,\n    style = props.style,\n    min = props.min,\n    max = props.max,\n    _props$step = props.step,\n    step = _props$step === void 0 ? 1 : _props$step,\n    defaultValue = props.defaultValue,\n    value = props.value,\n    disabled = props.disabled,\n    readOnly = props.readOnly,\n    upHandler = props.upHandler,\n    downHandler = props.downHandler,\n    keyboard = props.keyboard,\n    _props$controls = props.controls,\n    controls = _props$controls === void 0 ? true : _props$controls,\n    stringMode = props.stringMode,\n    parser = props.parser,\n    formatter = props.formatter,\n    precision = props.precision,\n    decimalSeparator = props.decimalSeparator,\n    onChange = props.onChange,\n    onInput = props.onInput,\n    onPressEnter = props.onPressEnter,\n    onStep = props.onStep,\n    inputProps = _objectWithoutProperties(props, _excluded);\n  var inputClassName = \"\".concat(prefixCls, \"-input\");\n  var inputRef = React.useRef(null);\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    focus = _React$useState2[0],\n    setFocus = _React$useState2[1];\n  var userTypingRef = React.useRef(false);\n  var compositionRef = React.useRef(false);\n  var shiftKeyRef = React.useRef(false);\n  // ============================ Value =============================\n  // Real value control\n  var _React$useState3 = React.useState(function () {\n      return getMiniDecimal(value !== null && value !== void 0 ? value : defaultValue);\n    }),\n    _React$useState4 = _slicedToArray(_React$useState3, 2),\n    decimalValue = _React$useState4[0],\n    setDecimalValue = _React$useState4[1];\n  function setUncontrolledDecimalValue(newDecimal) {\n    if (value === undefined) {\n      setDecimalValue(newDecimal);\n    }\n  }\n  // ====================== Parser & Formatter ======================\n  /**\n   * `precision` is used for formatter & onChange.\n   * It will auto generate by `value` & `step`.\n   * But it will not block user typing.\n   *\n   * Note: Auto generate `precision` is used for legacy logic.\n   * We should remove this since we already support high precision with BigInt.\n   *\n   * @param number  Provide which number should calculate precision\n   * @param userTyping  Change by user typing\n   */\n  var getPrecision = React.useCallback(function (numStr, userTyping) {\n    if (userTyping) {\n      return undefined;\n    }\n    if (precision >= 0) {\n      return precision;\n    }\n    return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));\n  }, [precision, step]);\n  // >>> Parser\n  var mergedParser = React.useCallback(function (num) {\n    var numStr = String(num);\n    if (parser) {\n      return parser(numStr);\n    }\n    var parsedStr = numStr;\n    if (decimalSeparator) {\n      parsedStr = parsedStr.replace(decimalSeparator, '.');\n    }\n    // [Legacy] We still support auto convert `$ 123,456` to `123456`\n    return parsedStr.replace(/[^\\w.-]+/g, '');\n  }, [parser, decimalSeparator]);\n  // >>> Formatter\n  var inputValueRef = React.useRef('');\n  var mergedFormatter = React.useCallback(function (number, userTyping) {\n    if (formatter) {\n      return formatter(number, {\n        userTyping: userTyping,\n        input: String(inputValueRef.current)\n      });\n    }\n    var str = typeof number === 'number' ? num2str(number) : number;\n    // User typing will not auto format with precision directly\n    if (!userTyping) {\n      var mergedPrecision = getPrecision(str, userTyping);\n      if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {\n        // Separator\n        var separatorStr = decimalSeparator || '.';\n        str = toFixed(str, separatorStr, mergedPrecision);\n      }\n    }\n    return str;\n  }, [formatter, getPrecision, decimalSeparator]);\n  // ========================== InputValue ==========================\n  /**\n   * Input text value control\n   *\n   * User can not update input content directly. It update with follow rules by priority:\n   *  1. controlled `value` changed\n   *    * [SPECIAL] Typing like `1.` should not immediately convert to `1`\n   *  2. User typing with format (not precision)\n   *  3. Blur or Enter trigger revalidate\n   */\n  var _React$useState5 = React.useState(function () {\n      var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;\n      if (decimalValue.isInvalidate() && ['string', 'number'].includes(_typeof(initValue))) {\n        return Number.isNaN(initValue) ? '' : initValue;\n      }\n      return mergedFormatter(decimalValue.toString(), false);\n    }),\n    _React$useState6 = _slicedToArray(_React$useState5, 2),\n    inputValue = _React$useState6[0],\n    setInternalInputValue = _React$useState6[1];\n  inputValueRef.current = inputValue;\n  // Should always be string\n  function setInputValue(newValue, userTyping) {\n    setInternalInputValue(mergedFormatter(\n    // Invalidate number is sometime passed by external control, we should let it go\n    // Otherwise is controlled by internal interactive logic which check by userTyping\n    // You can ref 'show limited value when input is not focused' test for more info.\n    newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n  }\n  // >>> Max & Min limit\n  var maxDecimal = React.useMemo(function () {\n    return getDecimalIfValidate(max);\n  }, [max, precision]);\n  var minDecimal = React.useMemo(function () {\n    return getDecimalIfValidate(min);\n  }, [min, precision]);\n  var upDisabled = React.useMemo(function () {\n    if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {\n      return false;\n    }\n    return maxDecimal.lessEquals(decimalValue);\n  }, [maxDecimal, decimalValue]);\n  var downDisabled = React.useMemo(function () {\n    if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {\n      return false;\n    }\n    return decimalValue.lessEquals(minDecimal);\n  }, [minDecimal, decimalValue]);\n  // Cursor controller\n  var _useCursor = useCursor(inputRef.current, focus),\n    _useCursor2 = _slicedToArray(_useCursor, 2),\n    recordCursor = _useCursor2[0],\n    restoreCursor = _useCursor2[1];\n  // ============================= Data =============================\n  /**\n   * Find target value closet within range.\n   * e.g. [11, 28]:\n   *    3  => 11\n   *    23 => 23\n   *    99 => 28\n   */\n  var getRangeValue = function getRangeValue(target) {\n    // target > max\n    if (maxDecimal && !target.lessEquals(maxDecimal)) {\n      return maxDecimal;\n    }\n    // target < min\n    if (minDecimal && !minDecimal.lessEquals(target)) {\n      return minDecimal;\n    }\n    return null;\n  };\n  /**\n   * Check value is in [min, max] range\n   */\n  var isInRange = function isInRange(target) {\n    return !getRangeValue(target);\n  };\n  /**\n   * Trigger `onChange` if value validated and not equals of origin.\n   * Return the value that re-align in range.\n   */\n  var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {\n    var updateValue = newValue;\n    var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();\n    // Skip align value when trigger value is empty.\n    // We just trigger onChange(null)\n    // This should not block user typing\n    if (!updateValue.isEmpty() && !userTyping) {\n      // Revert value in range if needed\n      updateValue = getRangeValue(updateValue) || updateValue;\n      isRangeValidate = true;\n    }\n    if (!readOnly && !disabled && isRangeValidate) {\n      var numStr = updateValue.toString();\n      var mergedPrecision = getPrecision(numStr, userTyping);\n      if (mergedPrecision >= 0) {\n        updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision));\n        // When to fixed. The value may out of min & max range.\n        // 4 in [0, 3.8] => 3.8 => 4 (toFixed)\n        if (!isInRange(updateValue)) {\n          updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision, true));\n        }\n      }\n      // Trigger event\n      if (!updateValue.equals(decimalValue)) {\n        setUncontrolledDecimalValue(updateValue);\n        onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));\n        // Reformat input if value is not controlled\n        if (value === undefined) {\n          setInputValue(updateValue, userTyping);\n        }\n      }\n      return updateValue;\n    }\n    return decimalValue;\n  };\n  // ========================== User Input ==========================\n  var onNextPromise = useFrame();\n  // >>> Collect input value\n  var collectInputValue = function collectInputValue(inputStr) {\n    recordCursor();\n    // Update inputValue incase input can not parse as number\n    setInternalInputValue(inputStr);\n    // Parse number\n    if (!compositionRef.current) {\n      var finalValue = mergedParser(inputStr);\n      var finalDecimal = getMiniDecimal(finalValue);\n      if (!finalDecimal.isNaN()) {\n        triggerValueUpdate(finalDecimal, true);\n      }\n    }\n    // Trigger onInput later to let user customize value if they want do handle something after onChange\n    onInput === null || onInput === void 0 ? void 0 : onInput(inputStr);\n    // optimize for chinese input experience\n    // https://github.com/ant-design/ant-design/issues/8196\n    onNextPromise(function () {\n      var nextInputStr = inputStr;\n      if (!parser) {\n        nextInputStr = inputStr.replace(/。/g, '.');\n      }\n      if (nextInputStr !== inputStr) {\n        collectInputValue(nextInputStr);\n      }\n    });\n  };\n  // >>> Composition\n  var onCompositionStart = function onCompositionStart() {\n    compositionRef.current = true;\n  };\n  var onCompositionEnd = function onCompositionEnd() {\n    compositionRef.current = false;\n    collectInputValue(inputRef.current.value);\n  };\n  // >>> Input\n  var onInternalInput = function onInternalInput(e) {\n    collectInputValue(e.target.value);\n  };\n  // ============================= Step =============================\n  var onInternalStep = function onInternalStep(up) {\n    var _inputRef$current;\n    // Ignore step since out of range\n    if (up && upDisabled || !up && downDisabled) {\n      return;\n    }\n    // Clear typing status since it may caused by up & down key.\n    // We should sync with input value.\n    userTypingRef.current = false;\n    var stepDecimal = getMiniDecimal(shiftKeyRef.current ? getDecupleSteps(step) : step);\n    if (!up) {\n      stepDecimal = stepDecimal.negate();\n    }\n    var target = (decimalValue || getMiniDecimal(0)).add(stepDecimal.toString());\n    var updatedValue = triggerValueUpdate(target, false);\n    onStep === null || onStep === void 0 ? void 0 : onStep(getDecimalValue(stringMode, updatedValue), {\n      offset: shiftKeyRef.current ? getDecupleSteps(step) : step,\n      type: up ? 'up' : 'down'\n    });\n    (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();\n  };\n  // ============================ Flush =============================\n  /**\n   * Flush current input content to trigger value change & re-formatter input if needed\n   */\n  var flushInputValue = function flushInputValue(userTyping) {\n    var parsedValue = getMiniDecimal(mergedParser(inputValue));\n    var formatValue = parsedValue;\n    if (!parsedValue.isNaN()) {\n      // Only validate value or empty value can be re-fill to inputValue\n      // Reassign the formatValue within ranged of trigger control\n      formatValue = triggerValueUpdate(parsedValue, userTyping);\n    } else {\n      formatValue = decimalValue;\n    }\n    if (value !== undefined) {\n      // Reset back with controlled value first\n      setInputValue(decimalValue, false);\n    } else if (!formatValue.isNaN()) {\n      // Reset input back since no validate value\n      setInputValue(formatValue, false);\n    }\n  };\n  // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)\n  var onBeforeInput = function onBeforeInput() {\n    userTypingRef.current = true;\n  };\n  var onKeyDown = function onKeyDown(event) {\n    var which = event.which,\n      shiftKey = event.shiftKey;\n    userTypingRef.current = true;\n    if (shiftKey) {\n      shiftKeyRef.current = true;\n    } else {\n      shiftKeyRef.current = false;\n    }\n    if (which === KeyCode.ENTER) {\n      if (!compositionRef.current) {\n        userTypingRef.current = false;\n      }\n      flushInputValue(false);\n      onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event);\n    }\n    if (keyboard === false) {\n      return;\n    }\n    // Do step\n    if (!compositionRef.current && [KeyCode.UP, KeyCode.DOWN].includes(which)) {\n      onInternalStep(KeyCode.UP === which);\n      event.preventDefault();\n    }\n  };\n  var onKeyUp = function onKeyUp() {\n    userTypingRef.current = false;\n    shiftKeyRef.current = false;\n  };\n  // >>> Focus & Blur\n  var onBlur = function onBlur() {\n    flushInputValue(false);\n    setFocus(false);\n    userTypingRef.current = false;\n  };\n  // ========================== Controlled ==========================\n  // Input by precision\n  useLayoutUpdateEffect(function () {\n    if (!decimalValue.isInvalidate()) {\n      setInputValue(decimalValue, false);\n    }\n  }, [precision]);\n  // Input by value\n  useLayoutUpdateEffect(function () {\n    var newValue = getMiniDecimal(value);\n    setDecimalValue(newValue);\n    var currentParsedValue = getMiniDecimal(mergedParser(inputValue));\n    // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.\n    // But let it go if user set `formatter`\n    if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {\n      // Update value as effect\n      setInputValue(newValue, userTypingRef.current);\n    }\n  }, [value]);\n  // ============================ Cursor ============================\n  useLayoutUpdateEffect(function () {\n    if (formatter) {\n      restoreCursor();\n    }\n  }, [inputValue]);\n  // ============================ Render ============================\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-focused\"), focus), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames, \"\".concat(prefixCls, \"-not-a-number\"), decimalValue.isNaN()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-out-of-range\"), !decimalValue.isInvalidate() && !isInRange(decimalValue)), _classNames)),\n    style: style,\n    onFocus: function onFocus() {\n      setFocus(true);\n    },\n    onBlur: onBlur,\n    onKeyDown: onKeyDown,\n    onKeyUp: onKeyUp,\n    onCompositionStart: onCompositionStart,\n    onCompositionEnd: onCompositionEnd,\n    onBeforeInput: onBeforeInput\n  }, controls && /*#__PURE__*/React.createElement(StepHandler, {\n    prefixCls: prefixCls,\n    upNode: upHandler,\n    downNode: downHandler,\n    upDisabled: upDisabled,\n    downDisabled: downDisabled,\n    onStep: onInternalStep\n  }), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(inputClassName, \"-wrap\")\n  }, /*#__PURE__*/React.createElement(\"input\", _extends({\n    autoComplete: \"off\",\n    role: \"spinbutton\",\n    \"aria-valuemin\": min,\n    \"aria-valuemax\": max,\n    \"aria-valuenow\": decimalValue.isInvalidate() ? null : decimalValue.toString(),\n    step: step\n  }, inputProps, {\n    ref: composeRef(inputRef, ref),\n    className: inputClassName,\n    value: inputValue,\n    onChange: onInternalInput,\n    disabled: disabled,\n    readOnly: readOnly\n  }))));\n});\nInputNumber.displayName = 'InputNumber';\nexport default InputNumber;","map":{"version":3,"names":["_extends","_defineProperty","_typeof","_slicedToArray","_objectWithoutProperties","_excluded","React","classNames","KeyCode","useLayoutUpdateEffect","composeRef","getMiniDecimal","toFixed","getNumberPrecision","num2str","validateNumber","StepHandler","getDecupleSteps","useCursor","useFrame","getDecimalValue","stringMode","decimalValue","isEmpty","toString","toNumber","getDecimalIfValidate","value","decimal","isInvalidate","InputNumber","forwardRef","props","ref","_classNames","_props$prefixCls","prefixCls","className","style","min","max","_props$step","step","defaultValue","disabled","readOnly","upHandler","downHandler","keyboard","_props$controls","controls","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","inputProps","inputClassName","concat","inputRef","useRef","_React$useState","useState","_React$useState2","focus","setFocus","userTypingRef","compositionRef","shiftKeyRef","_React$useState3","_React$useState4","setDecimalValue","setUncontrolledDecimalValue","newDecimal","undefined","getPrecision","useCallback","numStr","userTyping","Math","mergedParser","num","String","parsedStr","replace","inputValueRef","mergedFormatter","number","input","current","str","mergedPrecision","separatorStr","_React$useState5","initValue","includes","Number","isNaN","_React$useState6","inputValue","setInternalInputValue","setInputValue","newValue","maxDecimal","useMemo","minDecimal","upDisabled","lessEquals","downDisabled","_useCursor","_useCursor2","recordCursor","restoreCursor","getRangeValue","target","isInRange","triggerValueUpdate","updateValue","isRangeValidate","equals","onNextPromise","collectInputValue","inputStr","finalValue","finalDecimal","nextInputStr","onCompositionStart","onCompositionEnd","onInternalInput","e","onInternalStep","up","_inputRef$current","stepDecimal","negate","add","updatedValue","offset","type","flushInputValue","parsedValue","formatValue","onBeforeInput","onKeyDown","event","which","shiftKey","ENTER","UP","DOWN","preventDefault","onKeyUp","onBlur","currentParsedValue","createElement","onFocus","upNode","downNode","autoComplete","role","displayName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-input-number/es/InputNumber.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"min\", \"max\", \"step\", \"defaultValue\", \"value\", \"disabled\", \"readOnly\", \"upHandler\", \"downHandler\", \"keyboard\", \"controls\", \"stringMode\", \"parser\", \"formatter\", \"precision\", \"decimalSeparator\", \"onChange\", \"onInput\", \"onPressEnter\", \"onStep\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport { useLayoutUpdateEffect } from \"rc-util/es/hooks/useLayoutEffect\";\nimport { composeRef } from \"rc-util/es/ref\";\nimport getMiniDecimal, { toFixed, getNumberPrecision, num2str, validateNumber } from '@rc-component/mini-decimal';\nimport StepHandler from './StepHandler';\nimport { getDecupleSteps } from './utils/numberUtil';\nimport useCursor from './hooks/useCursor';\nimport useFrame from './hooks/useFrame';\n/**\n * We support `stringMode` which need handle correct type when user call in onChange\n * format max or min value\n * 1. if isInvalid return null\n * 2. if precision is undefined, return decimal\n * 3. format with precision\n *    I. if max > 0, round down with precision. Example: max= 3.5, precision=0  afterFormat: 3\n *    II. if max < 0, round up with precision. Example: max= -3.5, precision=0  afterFormat: -4\n *    III. if min > 0, round up with precision. Example: min= 3.5, precision=0  afterFormat: 4\n *    IV. if min < 0, round down with precision. Example: max= -3.5, precision=0  afterFormat: -3\n */\nvar getDecimalValue = function getDecimalValue(stringMode, decimalValue) {\n  if (stringMode || decimalValue.isEmpty()) {\n    return decimalValue.toString();\n  }\n  return decimalValue.toNumber();\n};\nvar getDecimalIfValidate = function getDecimalIfValidate(value) {\n  var decimal = getMiniDecimal(value);\n  return decimal.isInvalidate() ? null : decimal;\n};\nvar InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _classNames;\n  var _props$prefixCls = props.prefixCls,\n    prefixCls = _props$prefixCls === void 0 ? 'rc-input-number' : _props$prefixCls,\n    className = props.className,\n    style = props.style,\n    min = props.min,\n    max = props.max,\n    _props$step = props.step,\n    step = _props$step === void 0 ? 1 : _props$step,\n    defaultValue = props.defaultValue,\n    value = props.value,\n    disabled = props.disabled,\n    readOnly = props.readOnly,\n    upHandler = props.upHandler,\n    downHandler = props.downHandler,\n    keyboard = props.keyboard,\n    _props$controls = props.controls,\n    controls = _props$controls === void 0 ? true : _props$controls,\n    stringMode = props.stringMode,\n    parser = props.parser,\n    formatter = props.formatter,\n    precision = props.precision,\n    decimalSeparator = props.decimalSeparator,\n    onChange = props.onChange,\n    onInput = props.onInput,\n    onPressEnter = props.onPressEnter,\n    onStep = props.onStep,\n    inputProps = _objectWithoutProperties(props, _excluded);\n  var inputClassName = \"\".concat(prefixCls, \"-input\");\n  var inputRef = React.useRef(null);\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    focus = _React$useState2[0],\n    setFocus = _React$useState2[1];\n  var userTypingRef = React.useRef(false);\n  var compositionRef = React.useRef(false);\n  var shiftKeyRef = React.useRef(false);\n  // ============================ Value =============================\n  // Real value control\n  var _React$useState3 = React.useState(function () {\n      return getMiniDecimal(value !== null && value !== void 0 ? value : defaultValue);\n    }),\n    _React$useState4 = _slicedToArray(_React$useState3, 2),\n    decimalValue = _React$useState4[0],\n    setDecimalValue = _React$useState4[1];\n  function setUncontrolledDecimalValue(newDecimal) {\n    if (value === undefined) {\n      setDecimalValue(newDecimal);\n    }\n  }\n  // ====================== Parser & Formatter ======================\n  /**\n   * `precision` is used for formatter & onChange.\n   * It will auto generate by `value` & `step`.\n   * But it will not block user typing.\n   *\n   * Note: Auto generate `precision` is used for legacy logic.\n   * We should remove this since we already support high precision with BigInt.\n   *\n   * @param number  Provide which number should calculate precision\n   * @param userTyping  Change by user typing\n   */\n  var getPrecision = React.useCallback(function (numStr, userTyping) {\n    if (userTyping) {\n      return undefined;\n    }\n    if (precision >= 0) {\n      return precision;\n    }\n    return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));\n  }, [precision, step]);\n  // >>> Parser\n  var mergedParser = React.useCallback(function (num) {\n    var numStr = String(num);\n    if (parser) {\n      return parser(numStr);\n    }\n    var parsedStr = numStr;\n    if (decimalSeparator) {\n      parsedStr = parsedStr.replace(decimalSeparator, '.');\n    }\n    // [Legacy] We still support auto convert `$ 123,456` to `123456`\n    return parsedStr.replace(/[^\\w.-]+/g, '');\n  }, [parser, decimalSeparator]);\n  // >>> Formatter\n  var inputValueRef = React.useRef('');\n  var mergedFormatter = React.useCallback(function (number, userTyping) {\n    if (formatter) {\n      return formatter(number, {\n        userTyping: userTyping,\n        input: String(inputValueRef.current)\n      });\n    }\n    var str = typeof number === 'number' ? num2str(number) : number;\n    // User typing will not auto format with precision directly\n    if (!userTyping) {\n      var mergedPrecision = getPrecision(str, userTyping);\n      if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) {\n        // Separator\n        var separatorStr = decimalSeparator || '.';\n        str = toFixed(str, separatorStr, mergedPrecision);\n      }\n    }\n    return str;\n  }, [formatter, getPrecision, decimalSeparator]);\n  // ========================== InputValue ==========================\n  /**\n   * Input text value control\n   *\n   * User can not update input content directly. It update with follow rules by priority:\n   *  1. controlled `value` changed\n   *    * [SPECIAL] Typing like `1.` should not immediately convert to `1`\n   *  2. User typing with format (not precision)\n   *  3. Blur or Enter trigger revalidate\n   */\n  var _React$useState5 = React.useState(function () {\n      var initValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;\n      if (decimalValue.isInvalidate() && ['string', 'number'].includes(_typeof(initValue))) {\n        return Number.isNaN(initValue) ? '' : initValue;\n      }\n      return mergedFormatter(decimalValue.toString(), false);\n    }),\n    _React$useState6 = _slicedToArray(_React$useState5, 2),\n    inputValue = _React$useState6[0],\n    setInternalInputValue = _React$useState6[1];\n  inputValueRef.current = inputValue;\n  // Should always be string\n  function setInputValue(newValue, userTyping) {\n    setInternalInputValue(mergedFormatter(\n    // Invalidate number is sometime passed by external control, we should let it go\n    // Otherwise is controlled by internal interactive logic which check by userTyping\n    // You can ref 'show limited value when input is not focused' test for more info.\n    newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));\n  }\n  // >>> Max & Min limit\n  var maxDecimal = React.useMemo(function () {\n    return getDecimalIfValidate(max);\n  }, [max, precision]);\n  var minDecimal = React.useMemo(function () {\n    return getDecimalIfValidate(min);\n  }, [min, precision]);\n  var upDisabled = React.useMemo(function () {\n    if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) {\n      return false;\n    }\n    return maxDecimal.lessEquals(decimalValue);\n  }, [maxDecimal, decimalValue]);\n  var downDisabled = React.useMemo(function () {\n    if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) {\n      return false;\n    }\n    return decimalValue.lessEquals(minDecimal);\n  }, [minDecimal, decimalValue]);\n  // Cursor controller\n  var _useCursor = useCursor(inputRef.current, focus),\n    _useCursor2 = _slicedToArray(_useCursor, 2),\n    recordCursor = _useCursor2[0],\n    restoreCursor = _useCursor2[1];\n  // ============================= Data =============================\n  /**\n   * Find target value closet within range.\n   * e.g. [11, 28]:\n   *    3  => 11\n   *    23 => 23\n   *    99 => 28\n   */\n  var getRangeValue = function getRangeValue(target) {\n    // target > max\n    if (maxDecimal && !target.lessEquals(maxDecimal)) {\n      return maxDecimal;\n    }\n    // target < min\n    if (minDecimal && !minDecimal.lessEquals(target)) {\n      return minDecimal;\n    }\n    return null;\n  };\n  /**\n   * Check value is in [min, max] range\n   */\n  var isInRange = function isInRange(target) {\n    return !getRangeValue(target);\n  };\n  /**\n   * Trigger `onChange` if value validated and not equals of origin.\n   * Return the value that re-align in range.\n   */\n  var triggerValueUpdate = function triggerValueUpdate(newValue, userTyping) {\n    var updateValue = newValue;\n    var isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();\n    // Skip align value when trigger value is empty.\n    // We just trigger onChange(null)\n    // This should not block user typing\n    if (!updateValue.isEmpty() && !userTyping) {\n      // Revert value in range if needed\n      updateValue = getRangeValue(updateValue) || updateValue;\n      isRangeValidate = true;\n    }\n    if (!readOnly && !disabled && isRangeValidate) {\n      var numStr = updateValue.toString();\n      var mergedPrecision = getPrecision(numStr, userTyping);\n      if (mergedPrecision >= 0) {\n        updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision));\n        // When to fixed. The value may out of min & max range.\n        // 4 in [0, 3.8] => 3.8 => 4 (toFixed)\n        if (!isInRange(updateValue)) {\n          updateValue = getMiniDecimal(toFixed(numStr, '.', mergedPrecision, true));\n        }\n      }\n      // Trigger event\n      if (!updateValue.equals(decimalValue)) {\n        setUncontrolledDecimalValue(updateValue);\n        onChange === null || onChange === void 0 ? void 0 : onChange(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));\n        // Reformat input if value is not controlled\n        if (value === undefined) {\n          setInputValue(updateValue, userTyping);\n        }\n      }\n      return updateValue;\n    }\n    return decimalValue;\n  };\n  // ========================== User Input ==========================\n  var onNextPromise = useFrame();\n  // >>> Collect input value\n  var collectInputValue = function collectInputValue(inputStr) {\n    recordCursor();\n    // Update inputValue incase input can not parse as number\n    setInternalInputValue(inputStr);\n    // Parse number\n    if (!compositionRef.current) {\n      var finalValue = mergedParser(inputStr);\n      var finalDecimal = getMiniDecimal(finalValue);\n      if (!finalDecimal.isNaN()) {\n        triggerValueUpdate(finalDecimal, true);\n      }\n    }\n    // Trigger onInput later to let user customize value if they want do handle something after onChange\n    onInput === null || onInput === void 0 ? void 0 : onInput(inputStr);\n    // optimize for chinese input experience\n    // https://github.com/ant-design/ant-design/issues/8196\n    onNextPromise(function () {\n      var nextInputStr = inputStr;\n      if (!parser) {\n        nextInputStr = inputStr.replace(/。/g, '.');\n      }\n      if (nextInputStr !== inputStr) {\n        collectInputValue(nextInputStr);\n      }\n    });\n  };\n  // >>> Composition\n  var onCompositionStart = function onCompositionStart() {\n    compositionRef.current = true;\n  };\n  var onCompositionEnd = function onCompositionEnd() {\n    compositionRef.current = false;\n    collectInputValue(inputRef.current.value);\n  };\n  // >>> Input\n  var onInternalInput = function onInternalInput(e) {\n    collectInputValue(e.target.value);\n  };\n  // ============================= Step =============================\n  var onInternalStep = function onInternalStep(up) {\n    var _inputRef$current;\n    // Ignore step since out of range\n    if (up && upDisabled || !up && downDisabled) {\n      return;\n    }\n    // Clear typing status since it may caused by up & down key.\n    // We should sync with input value.\n    userTypingRef.current = false;\n    var stepDecimal = getMiniDecimal(shiftKeyRef.current ? getDecupleSteps(step) : step);\n    if (!up) {\n      stepDecimal = stepDecimal.negate();\n    }\n    var target = (decimalValue || getMiniDecimal(0)).add(stepDecimal.toString());\n    var updatedValue = triggerValueUpdate(target, false);\n    onStep === null || onStep === void 0 ? void 0 : onStep(getDecimalValue(stringMode, updatedValue), {\n      offset: shiftKeyRef.current ? getDecupleSteps(step) : step,\n      type: up ? 'up' : 'down'\n    });\n    (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();\n  };\n  // ============================ Flush =============================\n  /**\n   * Flush current input content to trigger value change & re-formatter input if needed\n   */\n  var flushInputValue = function flushInputValue(userTyping) {\n    var parsedValue = getMiniDecimal(mergedParser(inputValue));\n    var formatValue = parsedValue;\n    if (!parsedValue.isNaN()) {\n      // Only validate value or empty value can be re-fill to inputValue\n      // Reassign the formatValue within ranged of trigger control\n      formatValue = triggerValueUpdate(parsedValue, userTyping);\n    } else {\n      formatValue = decimalValue;\n    }\n    if (value !== undefined) {\n      // Reset back with controlled value first\n      setInputValue(decimalValue, false);\n    } else if (!formatValue.isNaN()) {\n      // Reset input back since no validate value\n      setInputValue(formatValue, false);\n    }\n  };\n  // Solve the issue of the event triggering sequence when entering numbers in chinese input (Safari)\n  var onBeforeInput = function onBeforeInput() {\n    userTypingRef.current = true;\n  };\n  var onKeyDown = function onKeyDown(event) {\n    var which = event.which,\n      shiftKey = event.shiftKey;\n    userTypingRef.current = true;\n    if (shiftKey) {\n      shiftKeyRef.current = true;\n    } else {\n      shiftKeyRef.current = false;\n    }\n    if (which === KeyCode.ENTER) {\n      if (!compositionRef.current) {\n        userTypingRef.current = false;\n      }\n      flushInputValue(false);\n      onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(event);\n    }\n    if (keyboard === false) {\n      return;\n    }\n    // Do step\n    if (!compositionRef.current && [KeyCode.UP, KeyCode.DOWN].includes(which)) {\n      onInternalStep(KeyCode.UP === which);\n      event.preventDefault();\n    }\n  };\n  var onKeyUp = function onKeyUp() {\n    userTypingRef.current = false;\n    shiftKeyRef.current = false;\n  };\n  // >>> Focus & Blur\n  var onBlur = function onBlur() {\n    flushInputValue(false);\n    setFocus(false);\n    userTypingRef.current = false;\n  };\n  // ========================== Controlled ==========================\n  // Input by precision\n  useLayoutUpdateEffect(function () {\n    if (!decimalValue.isInvalidate()) {\n      setInputValue(decimalValue, false);\n    }\n  }, [precision]);\n  // Input by value\n  useLayoutUpdateEffect(function () {\n    var newValue = getMiniDecimal(value);\n    setDecimalValue(newValue);\n    var currentParsedValue = getMiniDecimal(mergedParser(inputValue));\n    // When user typing from `1.2` to `1.`, we should not convert to `1` immediately.\n    // But let it go if user set `formatter`\n    if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) {\n      // Update value as effect\n      setInputValue(newValue, userTypingRef.current);\n    }\n  }, [value]);\n  // ============================ Cursor ============================\n  useLayoutUpdateEffect(function () {\n    if (formatter) {\n      restoreCursor();\n    }\n  }, [inputValue]);\n  // ============================ Render ============================\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-focused\"), focus), _defineProperty(_classNames, \"\".concat(prefixCls, \"-disabled\"), disabled), _defineProperty(_classNames, \"\".concat(prefixCls, \"-readonly\"), readOnly), _defineProperty(_classNames, \"\".concat(prefixCls, \"-not-a-number\"), decimalValue.isNaN()), _defineProperty(_classNames, \"\".concat(prefixCls, \"-out-of-range\"), !decimalValue.isInvalidate() && !isInRange(decimalValue)), _classNames)),\n    style: style,\n    onFocus: function onFocus() {\n      setFocus(true);\n    },\n    onBlur: onBlur,\n    onKeyDown: onKeyDown,\n    onKeyUp: onKeyUp,\n    onCompositionStart: onCompositionStart,\n    onCompositionEnd: onCompositionEnd,\n    onBeforeInput: onBeforeInput\n  }, controls && /*#__PURE__*/React.createElement(StepHandler, {\n    prefixCls: prefixCls,\n    upNode: upHandler,\n    downNode: downHandler,\n    upDisabled: upDisabled,\n    downDisabled: downDisabled,\n    onStep: onInternalStep\n  }), /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(inputClassName, \"-wrap\")\n  }, /*#__PURE__*/React.createElement(\"input\", _extends({\n    autoComplete: \"off\",\n    role: \"spinbutton\",\n    \"aria-valuemin\": min,\n    \"aria-valuemax\": max,\n    \"aria-valuenow\": decimalValue.isInvalidate() ? null : decimalValue.toString(),\n    step: step\n  }, inputProps, {\n    ref: composeRef(inputRef, ref),\n    className: inputClassName,\n    value: inputValue,\n    onChange: onInternalInput,\n    disabled: disabled,\n    readOnly: readOnly\n  }))));\n});\nInputNumber.displayName = 'InputNumber';\nexport default InputNumber;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,OAAO,MAAM,mCAAmC;AACvD,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,CAAC;AACrS,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,OAAOC,cAAc,IAAIC,OAAO,EAAEC,kBAAkB,EAAEC,OAAO,EAAEC,cAAc,QAAQ,4BAA4B;AACjH,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,eAAe,QAAQ,oBAAoB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,QAAQ,MAAM,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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